import request from '~/utils/resquest'

// 获取用户管理列表
export const getSystemUserList = <T>(params: T) =>
  request({
    url: '/api/gxsaas-system/user/listPage',
    method: 'get',
    params
  })

// 导出用户管理列表
export const exportSystemUserList = <T>(payload: T) =>
  request({
    url: '/api/gxsaas-system/user/export-template',
    method: 'get',
    responseType: 'blob',
    ...payload
  })

// 添加用户管理项
export const addSystemUserInfo = <T>(params: T) =>
  request({
    url: '/api/gxsaas-system/user/submit',
    method: 'post',
    data: params
  })

// 修改用户管理项
export const updateSystemUserInfo = <T>(params: T) =>
  request({
    url: '/api/gxsaas-system/user/update',
    method: 'post',
    data: params
  })

// 删除用户管理项
export const deleteSystemUserInfo = <T>(params: T) =>
  request({
    url: '/api/gxsaas-system/user/remove',
    method: 'post',
    params
  })

// 修改用户角色配置
export const updateSystemUserRoleGrant = <T>(params: T) =>
  request({
    url: '/api/gxsaas-system/user/grant',
    method: 'post',
    params
  })

// 重置用户密码
export const resetSystemUserPassword = <T>(params: T) =>
  request({
    url: '/api/gxsaas-system/user/reset-password',
    method: 'post',
    params
  })

// 获取所属租户下拉列表
export const getBelongTenantSelectList = <T>(params: T) =>
  request({
    url: '/api/gxsaas-system/tenant/select',
    method: 'get',
    params
  })
